package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.teach.domain.NbChapter;
import com.ruoyi.teach.domain.NbChapterPlanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbChapterPlanMapper;
import com.ruoyi.teach.domain.NbChapterPlan;
import com.ruoyi.teach.service.INbChapterPlanService;

/**
 * 章节时间计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbChapterPlanServiceImpl implements INbChapterPlanService 
{
    @Autowired
    private NbChapterPlanMapper nbChapterPlanMapper;

    /**
     * 查询章节时间计划
     * 
     * @param id 章节时间计划主键
     * @return 章节时间计划
     */
    @Override
    public NbChapterPlan selectNbChapterPlanById(Long id)
    {
        return nbChapterPlanMapper.selectNbChapterPlanById(id);
    }

    /**
     * 查询章节时间计划列表
     * 
     * @param nbChapterPlan 章节时间计划
     * @return 章节时间计划
     */
    @Override
    public List<NbChapterPlan> selectNbChapterPlanList(NbChapterPlan nbChapterPlan)
    {
        return nbChapterPlanMapper.selectNbChapterPlanList(nbChapterPlan);
    }

    /**
     * 新增章节时间计划
     * 
     * @param nbChapterPlan 章节时间计划
     * @return 结果
     */
    @Override
    public int insertNbChapterPlan(NbChapterPlan nbChapterPlan)
    {
        nbChapterPlan.setCreateTime(DateUtils.getNowDate());
        return nbChapterPlanMapper.insertNbChapterPlan(nbChapterPlan);
    }

    /**
     * 修改章节时间计划
     * 
     * @param nbChapterPlan 章节时间计划
     * @return 结果
     */
    @Override
    public int updateNbChapterPlan(NbChapterPlan nbChapterPlan)
    {
        return nbChapterPlanMapper.updateNbChapterPlan(nbChapterPlan);
    }

    /**
     * 批量删除章节时间计划
     * 
     * @param ids 需要删除的章节时间计划主键
     * @return 结果
     */
    @Override
    public int deleteNbChapterPlanByIds(Long[] ids)
    {
        return nbChapterPlanMapper.deleteNbChapterPlanByIds(ids);
    }

    /**
     * 删除章节时间计划信息
     * 
     * @param id 章节时间计划主键
     * @return 结果
     */
    @Override
    public int deleteNbChapterPlanById(Long id)
    {
        return nbChapterPlanMapper.deleteNbChapterPlanById(id);
    }

    @Override
    public List<NbChapterPlanVo> selectNbChapterPlans(NbChapter nbChapter) {
        return nbChapterPlanMapper.selectNbChapterPlans(nbChapter);
    }
}
